import  fetch from '../config/fetch'

let baseUrl = "http://www.xuedierhuo.cn/";


//分页查询所有学生
const Pageallstudents = "/stu/page";

//根据ID批量删除学生
const DeletestudentsbatsID = "/stu/deleteStudents/{ids}";

//根据id删除学生
const DeletetudentsbatID = "/stu/deleteStudent/{id}";

//根据id查询学生
const Querystudentsbyid = "/stu/findById";

//根据修改学生
const Accordingtothestudents = "/stu";

//根据多条件查询学生
const Multiplecriteriaquerystudents= "/stu/search";

//根据学生姓名模糊查询学生
const studentNameambiguityquerystudents= "/stu/name";

//根据宿舍id查询宿舍的所有学生
const Dormitoryidquerydormitoryallstudents= "/stu/selectByDormId/{dormId}";

//添加学生
const addstudent= "/stu";

//根据id删除宿舍
const Deletethedormaccordingtoid= "/dorm/{id}";

//根据id更新宿舍
const Updatethedormaccordingtoid= "/dorm/{id}";

//根据id查询宿舍
const Querythedormbyid= "/dorm/{id}";

//根据宿舍号查询宿舍
const Checkthedormitorynumber= "/drom/door/{doorword}";

//根据层id查宿舍
const Checkdormitoriesaccordingtofloorid= "/dorm/num/{id}";

//添加宿舍
const addThedormitory= "/drom/";

//根据楼id查询层
const Querytheflooraccordingtothebuildingid= "/floor";

//分页查询所有微信用户
const PagingqueryallWeChatusers= "/wxuser/page";

//快速查询配置
const Quickqueryconfiguration= "/wxuser/quicksearch";

//根据id删除微信端用户
const DeleteWeChatsideuseraccordingtoid= "/wxuser/{id}";

//根据id更新微信端用户
const UpdateWeChatsideuseraccordingtoid= "/wxuser/{id}";

//根据id查询微信端用户
const selectWeChatsideuseraccordingtoid= "/wxuser/{id}";

//添加微信端用户
const AddWeChatsideuser= "/wxuser/add";

//微信登录
const wxlog= "/wxuser/login";

//记录快捷查询
const Recordquickquery= "/wxuser/quicksearch";

//根据id更新数据终端用户
const Updatedataendusersbasedonid= "/user/{id}";

//数据终端登录
const log= "/user/login";

//退出数据终端登录
const exitlog= "/user/logout";

//保存当前日志
const addcurrentlog= "/log/add";

//分页查询所有日志
const Pagingqueryalllogs= "/log";

//更新系统自动保存日志时间
const Updatethesystemtoautomaticallysavelogtime= "/log/time";

//查询所有楼
const Searchallbuildings= "/house";

//更新学生状态
const Updatestudentstatus= "/visit/{id}";

//获得所有日志记录
const Getallthelogrecords= "/visit";


export default {
  baseUrl,
}


/**
 * 分页查询所有学生
 */
export const allstudents = data => fetch(Pageallstudents, data, 'GET');

/**
 * 根据ID批量删除学生
 */
export const Deletestudentsbats = data => fetch(DeletestudentsbatsID, data, 'DELETE');

/**
 * 根据id删除学生
 */
export const Deletetudentsbat = data => fetch(DeletetudentsbatID, data, 'DELETE');

/**
 * 根据id查询学生
 */
export const selectstudentsbyid = data => fetch(Querystudentsbyid, data, 'GET');

/**
 * 根据修改学生
 */
export const updatestudent = data => fetch(Accordingtothestudents, data, 'PUT');

/**
 * 根据多条件查询学生
 */
export const criteriaquerystudents = data => fetch(Multiplecriteriaquerystudents, data, 'GET');

/**
 * 根据学生姓名模糊查询学生
 */
export const Nameambiguityquerystudents = data => fetch(studentNameambiguityquerystudents, data, 'GET');

/**
 * 根据宿舍id查询宿舍的所有学生
 */
export const Dormitoryidqueryallstudents = data => fetch(Dormitoryidquerydormitoryallstudents, data, 'GET');

/**
 * 添加学生
 */
export const savestudent = data => fetch(addstudent, data, 'POST');

/**
 * 根据id删除宿舍
 */
export const DeleteidThedormitory = data => fetch(Deletethedormaccordingtoid, data, 'DELETE');

/**
 * 根据id更新宿舍
 */
export const UpdateidThedormitory = data => fetch(Updatethedormaccordingtoid, data, 'PUT');

/**
 * 根据id查询宿舍
 */
export const selectallThedormitory = data => fetch(Querythedormbyid, data, 'GET');

/**
 * 根据宿舍号查询宿舍
 */
export const Dormitorynumberinquirydormitory = data => fetch(Checkthedormitorynumber, data, 'GET');

/**
 * 根据层id查宿舍
 */
export const layeridselectThedormitory = data => fetch(Checkdormitoriesaccordingtofloorid, data, 'GET');

/**
 * 添加宿舍
 */
export const saveThedormitory = data => fetch(addThedormitory, data, 'POST');


/**
 * 根据楼id查询层
 */
export const Flooridqueryfloor = data => fetch(Querytheflooraccordingtothebuildingid, data, 'GET');


/**
 * 分页查询所有微信用户
 */
export const pageallWeChatusers = data => fetch(PagingqueryallWeChatusers, data, 'GET');

/**
 * 快速查询配置
 */
export const Quickselectconfiguration = data => fetch(Quickqueryconfiguration, data, 'GET');

/**
 * 根据id删除微信端用户
 */
export const Deleteidwxuser = data => fetch(DeleteWeChatsideuseraccordingtoid, data, 'DELETE');

/**
 * 根据id更新微信端用户
 */
export const Updateidwxuser = data => fetch(UpdateWeChatsideuseraccordingtoid, data, 'PUT');

/**
 * 根据id查询微信端用户
 */
export const Selectidwxuser = data => fetch(selectWeChatsideuseraccordingtoid, data, 'GET');

/**
 * 添加微信端用户
 */
export const Addidwxuser = data => fetch(AddWeChatsideuser, data, 'POST');

/**
 * 微信登录
 */
export const wxlogin = data => fetch(wxlog, data, 'GET');

/**
 * 记录快捷查询
 */
export const Quickquery = data => fetch(Recordquickquery, data, 'GET');

/**
 * 根据id更新数据终端用户
 */
export const UpdateidDataterminaluser = data => fetch(Updatedataendusersbasedonid, data, 'PUT');

/**
 * 登录
 */
export const login = data => fetch(log, data, 'GET');

/**
 * 退出登录
 */
export const logout = data => fetch(exitlog, data, 'GET');

/**
 * 保存当前日志
 */
export const Savecurrentlog = data => fetch(addcurrentlog, data, 'GET');

/**
 * 分页查询所有日志
 */
export const pageselectalllogs = data => fetch(Pagingqueryalllogs, data, 'GET');

/**
 * 更新系统自动保存日志时间
 */
export const Updatesystemautomaticsavelogtime = data => fetch(Updatethesystemtoautomaticallysavelogtime, data, 'GET');

/**
 * 查询所有楼
 */
export const selectbuildings = data => fetch(Searchallbuildings, data, 'GET');

/**
 * 更新学生状态
 */
export const Updateuserstatus = data => fetch(Updatestudentstatus, data, 'POST');

/**
 * 获得所有日志记录
 */
export const Getalllogrecords = data => fetch(Getallthelogrecords, data, 'GET');